﻿using BillHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaxAssistantBase;

namespace DemoForBillOcr
{
   public class RestOrcTool
    {
        public static string Post(out string errorMessage, BasePostModel model,string apiurl)
        {
          
            try {
                var  result = RestTool.Post<RestResultModel>(apiurl, model);
                if (result != null)
                {
                    if (result.errorCode == CloudResultStateEnum.SUCCESS)//成功
                    {

                        errorMessage = result.errorMessage;
                     
                        return errorMessage;
                    }

                    errorMessage = result.errorMessage;
               
                }
                else
                {
                    errorMessage = "没有返回结果";
                 
                }


                return errorMessage;
            } catch (Exception ex) {
                Console.WriteLine(ex.Message);
              
                errorMessage = ex.Message;


                return errorMessage;
            }
        }

       
    }
}
